package com.atguigu.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 测试从spring-cloud-config上获取配置
 * @Author 69003
 * @Date 2020/5/21 18:01
 */
@RequestMapping("/config")
@RestController
public class TestConfigController {

    @Value("${person.name}")
    private String name;

    @Value("${person.age}")
    private Integer age;

    @Value("${person.addr}")
    private String addr;

    @GetMapping("/person")
    public String testConfig() {

        return "success!"+"name:"+name+",age"+age+"addr:"+addr;
    }
}
